home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Camelot / Camelot 084 (1990-10)(Swedish User Group of Amiga)(SE)(PD)[WB].zip / Camelot 084 (1990-10)(Swedish User Group of Amiga)(SE)(PD)[WB].adf / MakeC / iff.h < prev    next >
C/C++ Source or Header  |  1990-09-20  |  3KB  |  122 lines

  1. /*
  2.     This is a bunch of the IFF stuff from the ROM Kernal Manual.
  3. */
  4.  
  5. #define IFF_H    1
  6.  
  7. #include <stdio.h>
  8. #ifndef EXEC_TYPES_H
  9.     #include <exec/types.h>
  10. #endif
  11. #ifndef EXEC_MEMORY_H
  12.     #include <exec/memory.h>
  13. #endif
  14. #ifndef INTUITION_INTUITION_H
  15.     #include <intuition/intuition.h>
  16. #endif
  17. #ifndef INTUITION_SCREENS_H
  18.     #include <intuition/screens.h>
  19. #endif
  20.  
  21. #define SEEK_SET 0
  22.  
  23.  
  24.  
  25. typedef struct
  26.     {
  27.         LONG  ckID;
  28.         LONG  cksize;
  29.         UBYTE *ckdata;
  30.     }
  31. Chunk;
  32.  
  33. typedef LONG ID;
  34.  
  35. #define MakeID(a,b,c,d)      ((LONG)(a)<<24 | (LONG)(b)<<16 | (c)<<8 | (d))
  36.  
  37.  
  38. #define ID_FORM        MakeID('F','O','R','M')        /* chunk types */
  39. #define ID_LIST        MakeID('L','I','S','T')
  40. #define ID_PROP        MakeID('P','R','O','P')
  41. #define ID_CAT        MakeID('C','A','T',' ')
  42.  
  43. #define ID_BMHD        MakeID('B','M','H','D')        /* sub-types     */
  44. #define ID_BODY        MakeID('B','O','D','Y')        /* for IFF ILBMs */
  45. #define ID_CMAP        MakeID('C','M','A','P')
  46. #define ID_GRAB        MakeID('G','R','A','B')
  47. #define ID_DEST        MakeID('D','E','S','T')
  48. #define ID_SPRT        MakeID('S','P','R','T')
  49. #define ID_CAMG        MakeID('C','A','M','G')
  50.  
  51. typedef UBYTE Masking;                            /* more ILBM stuff */
  52.  
  53. #define mskNone                    0
  54. #define mskHasMask                1
  55. #define mskHasTransparentColor    2
  56. #define mskLasso                3
  57.  
  58. typedef UBYTE Compression;
  59.  
  60. #define cmpNone        0
  61. #define cmpByteRun1    1
  62.  
  63. typedef struct 
  64.     {
  65.         UWORD w,h;            /* width, height */
  66.         WORD  x,y;            /* pixel display position */
  67.         UBYTE nplanes;        /* number of bitplanes    */
  68.         Masking masking;    
  69.         Compression compression;
  70.         UBYTE pad1;            /* word-align next item */
  71.         UWORD TransparentColor;        /* transparent color... */
  72.         UBYTE xAspect, yAspect;        /* aspect ratio width:height */
  73.         WORD pageWidth,pageHeight;    /* source page size, in pixels */
  74.     }
  75. BitMapHeader;
  76.  
  77. typedef struct
  78.     {
  79.         UBYTE red, green, blue;
  80.     }
  81. ColorRegister;
  82.  
  83. typedef ColorRegister ColorMap[64];    
  84.                                         
  85. typedef struct 
  86.     {
  87.         unsigned pad1 :4, red :4, green :4, blue :4;
  88.     }
  89. Color4;
  90.  
  91. typedef struct
  92.     {
  93.         WORD x,y;
  94.     }
  95. Point2D;
  96.  
  97. typedef struct
  98.     {
  99.         UBYTE depth;        /* bitplanes in source image */
  100.         UBYTE pad1;
  101.         UWORD planePick;
  102.         UWORD planeOnOff;
  103.         UWORD planeMask;
  104.     }
  105. DestMerge;
  106.  
  107. typedef UWORD SpritePrecedence;
  108.  
  109. /* for viewmodes and the CAMG chunk type */
  110.  
  111. #define BADFLAGS    (SPRITES|VP_HIDE|GENLOCK_AUDIO|GENLOCK_VIDEO)
  112. #define FLAGMASK    (~BADFLAGS)
  113. #define CAMGMASK    (FLAGMASK & 0x0000FFFFL)
  114.  
  115.  
  116. BOOL GetBMHD(FILE *ifffile,BitMapHeader *header);
  117. ULONG PullID(UBYTE *data);
  118. BOOL GetViewModes(struct NewScreen *newscreen,FILE *ifffile);
  119. BOOL FindChunk(FILE *ifffile,ULONG chunktype,Chunk *chunk);
  120. SHORT GetColorMap(FILE *ifffile,UWORD *colortable);
  121. BOOL ReadPic(struct BitMap *bitmap,FILE *ifffile,BitMapHeader *header);
  122.